Left Termination of the query pattern perm_in_2(g, a) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

perm([], []).
perm(Xs, .(X, Ys)) :- ','(app(X1s, .(X, X2s), Xs), ','(app(X1s, X2s, Zs), perm(Zs, Ys))).
app([], X, X).
app(.(X, Xs), Ys, .(X, Zs)) :- app(Xs, Ys, Zs).

Queries:

perm(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
PERM_IN(Xs, .(X, Ys)) → APP_IN(X1s, .(X, X2s), Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → APP_IN(X1s, X2s, Zs)
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U31(Xs, X, Ys, perm_in(Zs, Ys))
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
APP_IN(x1, x2, x3)  =  APP_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
PERM_IN(Xs, .(X, Ys)) → APP_IN(X1s, .(X, X2s), Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → APP_IN(X1s, X2s, Zs)
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U31(Xs, X, Ys, perm_in(Zs, Ys))
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
APP_IN(x1, x2, x3)  =  APP_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 4 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
APP_IN(x1, x2, x3)  =  APP_IN

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APP_IN(x1, x2, x3)  =  APP_IN

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

APP_INAPP_IN

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

APP_INAPP_IN

The TRS R consists of the following rules:none


s = APP_IN evaluates to t =APP_IN

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from APP_IN to APP_IN.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))

The TRS R consists of the following rules:

app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U21(app_out(X1s)) → PERM_IN
U11(app_out(X1s)) → U21(app_in)
PERM_INU11(app_in)

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))

The set Q consists of the following terms:

app_in
U4(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule U11(app_out(X1s)) → U21(app_in) at position [0] we obtained the following new rules:

U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U21(app_out(X1s)) → PERM_IN
U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))
PERM_INU11(app_in)

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))

The set Q consists of the following terms:

app_in
U4(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule PERM_INU11(app_in) at position [0] we obtained the following new rules:

PERM_INU11(app_out([]))
PERM_INU11(U4(app_in))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
QDP
                                ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PERM_INU11(app_out([]))
U21(app_out(X1s)) → PERM_IN
PERM_INU11(U4(app_in))
U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))

The set Q consists of the following terms:

app_in
U4(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

PERM_INU11(app_out([]))
U21(app_out(X1s)) → PERM_IN
PERM_INU11(U4(app_in))
U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))


s = U11(app_out(y0)) evaluates to t =U11(app_out([]))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U11(app_out(y0))U21(app_out([]))
with rule U11(app_out(y0')) → U21(app_out([])) at position [] and matcher [y0' / y0]

U21(app_out([]))PERM_IN
with rule U21(app_out(X1s)) → PERM_IN at position [] and matcher [X1s / []]

PERM_INU11(app_out([]))
with rule PERM_INU11(app_out([]))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.




We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
PERM_IN(Xs, .(X, Ys)) → APP_IN(X1s, .(X, X2s), Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → APP_IN(X1s, X2s, Zs)
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U31(Xs, X, Ys, perm_in(Zs, Ys))
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
APP_IN(x1, x2, x3)  =  APP_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
PERM_IN(Xs, .(X, Ys)) → APP_IN(X1s, .(X, X2s), Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → APP_IN(X1s, X2s, Zs)
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U31(Xs, X, Ys, perm_in(Zs, Ys))
U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
APP_IN(x1, x2, x3)  =  APP_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 4 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
APP_IN(x1, x2, x3)  =  APP_IN

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APP_IN(x1, x2, x3)  =  APP_IN

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APP_INAPP_IN

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

APP_INAPP_IN

The TRS R consists of the following rules:none


s = APP_IN evaluates to t =APP_IN

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from APP_IN to APP_IN.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))

The TRS R consists of the following rules:

perm_in(Xs, .(X, Ys)) → U1(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U1(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U2(Xs, X, Ys, app_in(X1s, X2s, Zs))
U2(Xs, X, Ys, app_out(X1s, X2s, Zs)) → U3(Xs, X, Ys, perm_in(Zs, Ys))
perm_in([], []) → perm_out([], [])
U3(Xs, X, Ys, perm_out(Zs, Ys)) → perm_out(Xs, .(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U2(x1, x2, x3, x4)  =  U2(x4)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U21(Xs, X, Ys, app_out(X1s, X2s, Zs)) → PERM_IN(Zs, Ys)
U11(Xs, X, Ys, app_out(X1s, .(X, X2s), Xs)) → U21(Xs, X, Ys, app_in(X1s, X2s, Zs))
PERM_IN(Xs, .(X, Ys)) → U11(Xs, X, Ys, app_in(X1s, .(X, X2s), Xs))

The TRS R consists of the following rules:

app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
app_in(x1, x2, x3)  =  app_in
U4(x1, x2, x3, x4, x5)  =  U4(x5)
[]  =  []
app_out(x1, x2, x3)  =  app_out(x1)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U21(app_out(X1s)) → PERM_IN
U11(app_out(X1s)) → U21(app_in)
PERM_INU11(app_in)

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))

The set Q consists of the following terms:

app_in
U4(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule U11(app_out(X1s)) → U21(app_in) at position [0] we obtained the following new rules:

U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U21(app_out(X1s)) → PERM_IN
U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))
PERM_INU11(app_in)

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))

The set Q consists of the following terms:

app_in
U4(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule PERM_INU11(app_in) at position [0] we obtained the following new rules:

PERM_INU11(app_out([]))
PERM_INU11(U4(app_in))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Narrowing
QDP
                                ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

PERM_INU11(app_out([]))
U21(app_out(X1s)) → PERM_IN
PERM_INU11(U4(app_in))
U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))

The set Q consists of the following terms:

app_in
U4(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

PERM_INU11(app_out([]))
U21(app_out(X1s)) → PERM_IN
PERM_INU11(U4(app_in))
U11(app_out(y0)) → U21(app_out([]))
U11(app_out(y0)) → U21(U4(app_in))

The TRS R consists of the following rules:

app_inU4(app_in)
app_inapp_out([])
U4(app_out(Xs)) → app_out(.(Xs))


s = U11(app_out(y0)) evaluates to t =U11(app_out([]))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U11(app_out(y0))U21(app_out([]))
with rule U11(app_out(y0')) → U21(app_out([])) at position [] and matcher [y0' / y0]

U21(app_out([]))PERM_IN
with rule U21(app_out(X1s)) → PERM_IN at position [] and matcher [X1s / []]

PERM_INU11(app_out([]))
with rule PERM_INU11(app_out([]))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.